package br.com.rampage.model.bean;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
public class Carteira {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;

	@OneToOne(mappedBy = "carteira")
	private Paciente paciente;

	@OneToOne(mappedBy = "carteira")
	private Dependente dependete;

	
	@OneToMany(mappedBy = "carteira",fetch = FetchType.EAGER)
	private Set<Aplicacao> aplicacoes;

	public Carteira() {
		aplicacoes = new HashSet<Aplicacao>();
	}
	
	public Paciente getPaciente() {
		return paciente;
	}

	public void setPaciente(Paciente paciente) {
		this.paciente = paciente;
	}
	
	public Set<Aplicacao> getAplicacoes() {
		return aplicacoes;
	}

	public void setAplicacoes(Set<Aplicacao> aplicacoes) {
		this.aplicacoes = aplicacoes;
	}

	public Dependente getDependete() {
		return dependete;
	}

	public void setDependete(Dependente dependete) {
		this.dependete = dependete;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

}
